<?php 
$dossierId=getParameter("dossierId");
if ($dossierId){
?>

<div class="cadremenu">

<a onclick="javascript:dossierimages()" class="myButton"><img src="/butterflyportal/images/menu/cabinet_soin_images.png"  width="32">Images</a>
<a onclick="javascript:dossierradios()" class="myButton"><img src="/butterflyportal/images/menu/cabinet_soin_radios.png"  width="32">Radios</a>
<a onclick="javascript:dossieravances()" class="myButton"><img src="/butterflyportal/images/menu/cabinet_dossier_avance.png"  width="32">Avances</a>
<a onclick="javascript:rendezvous()" class="myButton"><img src="/butterflyportal/images/menu/cabinet_rendezvous.png"  width="32">Rendez-vous</a>

</div>



<div style="display: none">
<?php 

$SQL="SELECT

cabinet_soin_radios.image
FROM
cabinet_soins
INNER JOIN cabinet_soin_radios ON cabinet_soin_radios.soinId = cabinet_soins.id
WHERE
cabinet_soins.dossierId =  $dossierId";

$rs=ew_LoadRecordset($SQL);

while ($rs && !$rs->EOF)
{
	
	?>
	
	<a href="<?=getFilesPath("soinradios",false)."/".$rs->fields['image'];?>" class="soinimages" rel="radios"><img src="<?=getFilesPath("soinradios",false)."/".$rs->fields['image'];?>" width="32"></a>
	<?php 
	$rs->MoveNext();
	
}


$SQL="SELECT

cabinet_soin_images.image
FROM
cabinet_soins
INNER JOIN cabinet_soin_images ON cabinet_soin_images.soinId = cabinet_soins.id
WHERE
cabinet_soins.dossierId =  $dossierId";

$rs=ew_LoadRecordset($SQL);

while ($rs && !$rs->EOF)
{

	?>
	
	<a href="<?=getFilesPath("soinimages",false)."/".$rs->fields['image'];?>" class="soinimages" rel="images"><img src="<?=getFilesPath("soinimages",false)."/".$rs->fields['image'];?>" width="32"></a>
	<?php 
	$rs->MoveNext();
	
}

?>

</div>

<script type="text/javascript">

function dossierimages(){

	

	$("a[rel='images']").click();
}

function dossierradios(){

	if ($("a[rel='radios']")) $("a[rel='radios']").click(); else alert("ok");
}
function ajoutsalleattente(){





	$.get("/portlet.php",
	{app: "cabinet",
	operation:"ajoutsalleattente",
	dossierId:<?=$dossierId?>
	},
	   function(data){


		parent.document.location="?table=cabinet_attente&filter=1";


				});


	
	
}




$(document).ready(function() {

	
	
	$("a.soinimages").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});
	
});

</script>


<?php } ?>
